package com.youpai.platform.user.web.api;

import com.youpai.platform.common.entity.resp.BaseResponse;
import com.youpai.platform.user.service.entity.dto.UserActiveDTO;
import com.youpai.platform.user.service.service.UserActiveService;
import com.youpai.platform.user.service.service.UserService;
import com.youpai.platform.user.web.entity.dto.UserItemDTO;
import com.youpai.platform.user.web.entity.req.*;
import com.youpai.platform.user.web.entity.resp.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * @Description: 用户相关controller
 * @Author:welles
 * @Date:2022/7/23
 */
@Slf4j
@RestController
@RequestMapping(value = "/user/active")
@Api(value = "UserActiveController", tags = "用户状态相关")
public class UserActiveController {

    @Resource
    private UserActiveService userActiveService;

    @ApiOperation(value = "查询列表用户在线状态")
    @PostMapping(value = "/query")
    public BaseResponse<Map<Long, UserActiveDTO>> queryUserActive(@RequestBody List<String> uidList) {
        return BaseResponse.success(userActiveService.userActiveQuery(uidList));
    }

}
